<?php

class BaseConfig {
	const HTTP = "http://";
	const HTTPS = "https://";
	
	public static function COOCIE_EXPIRES() {
		return time()+(60*60*24*30*6);
	}
	
	public static function SCRIPT_NAME(){
		return MAIN_PAGE().$_SERVER['SCRIPT_NAME'];
	}
	
	public static function getHTTPString(){
		$ht = MAIN_PAGE().$_SERVER["SCRIPT_NAME"];
		$v = strlen(strrchr($ht,'/'));
		return substr_replace ($ht,'',strlen($ht)-$v,$v);
	}
	
	public static function MAIN_PAGE(){
		if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on")
			return self::HTTPS.$_SERVER['SERVER_NAME'];
		return self::HTTP.$_SERVER['SERVER_NAME'];
	}
}

?>